﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageNewsClass.aspx.cs" Inherits="Manageweb_ManageNews_ManageNewsClass" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    
<link href="../images/css.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table width="750" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td style="background-color:#507cd1; color:White; font-weight:bold; text-align:left;">
            &nbsp;管理文章类别</td>
      </tr>
    </table>
    <br />
        <table border="1" cellpadding="0" cellspacing="0" width="750" id="TABLE_Add_Mod" runat="server">
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1; text-align: left">
                    &nbsp;<asp:Label ID="LB_TableTitle" runat="server"></asp:Label>
                    <asp:Label ID="LB_ID" runat="server" Visible="False"></asp:Label></td>
            </tr>
            <tr>
                <td style="width:150px;">
                    &nbsp;标题名称</td>
                <td style="text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Title" runat="server" Width="240px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RFV_TB_Title" runat="server" ControlToValidate="TB_Title"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    &nbsp;所属类别</td>
                <td style="text-align: left">
                    &nbsp;<asp:DropDownList ID="DDL_Class" runat="server" Width="246px">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RFV_DDL_Class" runat="server" ControlToValidate="DDL_Class"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1">
                    <asp:Button ID="Btn_Submit" runat="server" Text="提交" ValidationGroup="Btn_Submit" />&nbsp;<asp:Button ID="Btn_Cancel"
                        runat="server" Text="取消" /></td>
            </tr>
        </table>
        <br />
            <asp:Label ID="LB_ManageNewsClass" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red"></asp:Label>
        <table border="1" cellpadding="0" cellspacing="0" width="750">
            <tr>
                <td>
                    <asp:GridView ID="GV_NewsClassList" runat="server" CellPadding="4" ForeColor="#333333"
                        Width="100%" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="NC_ID" DataSourceID="ODS_NewsClassList">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#EFF3FB" />
                        <EditRowStyle BackColor="#2461BF" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="NC_ID" HeaderText="NC_ID" InsertVisible="False" ReadOnly="True"
                                SortExpression="NC_ID" Visible="False" />
                            <asp:TemplateField HeaderText="标题" SortExpression="NC_Title">
                                <ItemStyle HorizontalAlign="Left" />
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# FormatClassTitle(Eval("NC_Title"), Eval("NC_Level")) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="NC_Level" HeaderText="级别" SortExpression="NC_Level" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LBtn_Add" runat="server" OnCommand="LBtn_Add_Command">添加</asp:LinkButton>
                                    <asp:LinkButton ID="LBtn_Mod" runat="server" CommandArgument='<%# Eval("NC_ID") %>' OnCommand="LBtn_Mod_Command">修改</asp:LinkButton>
                                    <asp:LinkButton ID="LBtn_Del" runat="server" CommandArgument='<%# Eval("NC_ID") %>' OnCommand="LBtn_Del_Command" OnClientClick="return confirm('删除操作不可恢复，是否继续？')">删除</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <asp:Button ID="Btn_Add" runat="server" Text="添加新类别" OnCommand="LBtn_Add_Command" />
                        </EmptyDataTemplate>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ODS_NewsClassList" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataOrderByClassCode" TypeName="AccessDAL.NewsClassTableAdapters.NewsClassTableAdapter">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="false" Name="NC_IsLock" Type="Boolean" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
        
    </div>
    </form>
</body>
</html>
